cmake_minimum_required(VERSION 3.0)

project(libuv-examples)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_module)

include_directories(${PROJECT_SOURCE_DIR}/include)

find_package(LibUV REQUIRED)
include_directories(${LIBUV_INCLUDE_DIRS})

find_package(Curses REQUIRED)
include_directories(${CURSES_INCLUDE_DIR})

add_executable (01_system_info 01_system_info.c)
target_link_libraries(01_system_info ${LIBUV_LIBRARIES})

add_executable (02_idle 02_idle.c)
target_link_libraries(02_idle ${LIBUV_LIBRARIES})

add_executable (03_fs_readsync 03_fs_readsync.c)
target_link_libraries(03_fs_readsync ${LIBUV_LIBRARIES})

add_executable (04_fs_readasync 04_fs_readasync.c)
target_link_libraries(04_fs_readasync ${LIBUV_LIBRARIES})

add_executable (05_fs_readasync_context 05_fs_readasync_context.c)
target_link_libraries(05_fs_readasync_context ${LIBUV_LIBRARIES})

add_executable (06_fs_allasync 06_fs_allasync.c)
target_link_libraries(06_fs_allasync ${LIBUV_LIBRARIES})

add_executable (07_tcp_echo_server 07_tcp_echo_server.c)
target_link_libraries(07_tcp_echo_server ${LIBUV_LIBRARIES})

add_executable (08_horse_race 08_horse_race.c)
target_link_libraries(08_horse_race ${LIBUV_LIBRARIES} ${CURSES_LIBRARY})
